#ifndef _D_C_O_L
#define _D_C_O_L
#include"../Global.h"
#include "../CommonUtils/ThreadPool/HzThreadPool.h"
#include "CudaService/CudaRGB32ToYUV444Service.h"
struct _XDisplay;
typedef struct _XDisplay Display;
using namespace std;

class DataCollect
{
public:
    DataCollect();
    DataCollect(int worderNum,int w,int h,int FrameRate);
    ~DataCollect();
public:
    //采集前的初始化工作
    int init();
    //采集工作结束释放资源
    int release();
public:
    int beginCollect(void* arg);
    /// \brief 主运行程序  开始采集
    void run();
    /// \brief 主运行程序  结束采集
    void stop();
public:
    /// @获取屏幕截图
    /// @param time 采集时间戳
    /// @return  采集的RGU字符流
    uchar*  getScreen(long& time);
public:
    HzThreadPool* pool;  //线程池：多线程采集
    vector<CudaRGB32ToYUV444Service*> services;//cuda服务
    int worderNum; //采集线程个数
    bool status;//采集状态
    //采集参数
    int w,h,FrameRate;   //分辨率  + 帧率
    Display *display;//设备
};




struct args
{
    DataCollect *dc;
    int pcID;
    args(DataCollect *dc, int pcID) : dc(dc), pcID(pcID) {}
};




#endif

